package com.feishi.core.util.bitbyte;

import com.feishi.core.util.bitbyte.dbc.DBCConfig;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class DBCUtil {
    public static void main(String[] args) throws IOException {
        File file=new File("C:\\Users\\caixq\\Desktop\\VF\\01_test\\CAN Matrix 17th edition\\01-B-Car-Body_CAN-Vehicle_Matrix_V2.1.0_20200115.dbc");
        readDBCFile(file);
    }
    public static void readDBCFile(File file) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "GBK"));
        String line=null;
        DBCConfig dbcConfig=new DBCConfig();
        while((line=reader.readLine())!=null){
            dbcConfig.readLine(line);
        }
        System.out.println("\n\n\n\n");
        System.out.println(dbcConfig);

    }
}
